Repository navigation
Add link and unsubscribe metadata to CLI reads - #310
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose email link destinations and newsletter unsubscribe metadata through the existing
omamail read/mail.readresult. This addresses the remaining newsletter-workflow gap discussed in #154: the CLI already lists, reads, sends and trashes mail, but previously discarded HTML anchor destinations and unsubscribe headers.message.links:{text, url}entries from anchors in the sanitized document, including links missing from a message's plain-text alternative.message.unsubscribe: deduplicatedurlsfromList-Unsubscribe, plus the sender'soneClickdeclaration when an HTTPS destination is available.oneClick: falsewhen this metadata is absent. Plain-text URLs stay in the body text. Provider metadata availability still applies.This is an additive, provider-neutral read projection. No new command or flag is needed, no QML dependency is introduced, and the plugin's backend pin/API requirements do not change. Cross-account search is tracked separately in #308.
Boundaries
Link extraction reuses the existing bounded sanitized-document traversal and validates the exported destination after HTML-entity decoding. HTTP(S) destinations use the existing public-host spelling policy; mailto destinations are returned as data. Raw HTML, image/resource URLs, unrelated headers and document attributes remain excluded. Reading still leaves read state unchanged and does not visit links or perform unsubscribe actions.
oneClickreports the sender's declaration, not verified DKIM coverage or permission to POST. The caller remains responsible for any subsequent network request, including DNS/address validation. Header URL bytes are not HTML-decoded.Verification
make validatestages passed across the initial run and the resumed remaining-stage run after a local harness restart: 570 Rust unit tests, 33 CLI tests, remaining Rust integrations, JavaScript/shell checks, 1,075 main QML tests, 6 Outlook and 64 sidebar checks, the native Qt resource-isolation test, standalone composition, QML lint and plugin validation.collapsible_if/needless_returndiagnostics in untouched calendar, credentials, IMAP and mail-test code; all-target Clippy passed with only those two lint classes allowed.Security
PASS — scoped to the new read projection. Sender-controlled anchor attributes are decoded once before destination validation; header targets retain their original non-HTML interpretation. Tests cover unsafe schemes, private/loopback and numeric-host spellings, ambiguous HTTP syntax, credentials, CR/LF/NUL, backslashes, Unicode, encoded quotes, HTML entities, missing metadata and nested-anchor label amplification. The projection contains no DNS, network, browser, process-launch or mail-mutation operation. Existing raw-content/resource exclusions and document bounds remain in force. This is not an audit of arbitrary downstream clients or live-provider behavior.
Release Notes